﻿using System;
using System.Linq;
using System.Threading;
using System.Collections.Generic;
using System.Windows.Forms;
namespace BIN
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] Args)
        {
            string mutexName = "UPTAPP";
            bool grantedOwnership;
            Mutex singleInstanceMutex = null;
            try
            {
                singleInstanceMutex = new Mutex(true, mutexName, out grantedOwnership);
                if (!grantedOwnership)
                {
                    Environment.Exit(0);
                    return;
                }
            }
            finally
            {
                singleInstanceMutex.Close();
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ShareMet.CheckDir();
            //是否从程序中调用
            ShareMet.CallFromMainProg = Args.Contains("/CALLFROMPROG",
                new StringCompareNoCase());
            Application.Run(new FrmUpdate());
        }
    }
}
